import { permissionUpdateSchema } from "~/validators/permission";
export default defineEventHandler(async (event) => {
  const result = await runValidate(permissionUpdateSchema, event);
  const newData = PermissionSchema.findByIdAndUpdate(
    result.data._id,
    result.data,
    {
      new: true,
    }
  );
  return newData;
});
